<template>
	<div id="contentBox">
		<div class="searchBox">
			<el-form :inline="true"  ref="searchForm"  :model="searchForm" label-width="96px">
				<el-form-item label="打款日期起" prop="startDate" >
				    <el-date-picker :editable="false"   
				      @change="debounceSeach"
				      v-model="searchForm.startDate"
				      type="date"
				      placeholder="选择日期"
				      :picker-options="startDateOpt"
				      >
				    </el-date-picker>
				</el-form-item>
				<el-form-item label="打款日期止" prop="endDate" >
				    <el-date-picker :editable="false"  
				      @change="debounceSeach"
				      v-model="searchForm.endDate"
				      type="date"
				      placeholder="选择日期"
				      :picker-options="endDateOpt"
				      >
				    </el-date-picker>
				</el-form-item>
	            <el-form-item label="订单号" prop="orderNumber" >
				    <el-input v-model="searchForm.orderNumber" placeholder="请输入搜索内容..." @input.native="debounceSeach"></el-input >
				</el-form-item>
				<el-form-item label="资金方" prop="funderName" >
				    <el-input v-model="searchForm.funderName" placeholder="请输入搜索内容..."  @input.native="debounceSeach"></el-input >
				</el-form-item>
				<el-form-item label="预计到期日起" prop="expectedStartDate" >
				    <el-date-picker :editable="false"   
				      @change="debounceSeach"
				      v-model="searchForm.expectedStartDate"
				      type="date"
				      placeholder="选择日期"
				      :picker-options="startDateOpt"
				      >
				    </el-date-picker>
				</el-form-item>
				<el-form-item label="预计到期日止" prop="expectedEndDate" >
				    <el-date-picker :editable="false"  
				      @change="debounceSeach"
				      v-model="searchForm.expectedEndDate"
				      type="date"
				      placeholder="选择日期"
				      :picker-options="endDateOpt1"
				      >
				    </el-date-picker>
				</el-form-item>
				<el-form-item label="经销商名称" prop="dealerName" >
				    <el-input v-model="searchForm.dealerName" placeholder="请输入搜索内容..."  @input.native="debounceSeach"></el-input >
				</el-form-item>
				<el-form-item label="业务员" prop="businessName" >
				    <el-input v-model="searchForm.businessName" placeholder="请输入搜索内容..."  @input.native="debounceSeach"></el-input >
				</el-form-item>
				
				<el-form-item label="汽车车型" prop="carName">
				  	<el-input v-model="searchForm.carName" placeholder="请输入搜索内容..." @input.native="debounceSeach"></el-input >
			    </el-form-item>
			    <el-form-item label="车架号" prop="vin">
				  	<el-input v-model="searchForm.vin" placeholder="请输入搜索内容..." @input.native="debounceSeach"></el-input >
			    </el-form-item>
			    <el-form-item label="是否逾期" prop="isOver">				   
				    <el-select v-model="searchForm.isOver" placeholder="请选择是否逾期" @change="debounceSeach">
				    	<el-option label="请选择是否逾期" value=""></el-option>			   
				    	<el-option label="逾期" value="逾期"></el-option>
				    	<el-option label="正常" value="正常"></el-option>
					</el-select>
				</el-form-item>
				<el-form-item label="服务费是否异常" prop="isInterest">				   
				    <el-select v-model="searchForm.isInterest" placeholder="请选择服务费是否异常" @change="debounceSeach">
				    	<el-option label="请选择服务费是否异常" value=""></el-option>			   
				    	<el-option label="异常" value="异常"></el-option>
				    	<el-option label="正常" value="正常"></el-option>
					</el-select>
				</el-form-item>	 
			    <el-form-item label="订单状态" prop="status">				   
				    <el-select v-model="searchForm.status" placeholder="请选择订单状态" @change="debounceSeach">
				    	<el-option label="请选择订单状态" value=""></el-option>		   
				    	<el-option v-for="(item, index) in carOrderStatusMap" :label="item" :value="index" :key="index"></el-option>
					</el-select>
				</el-form-item>	           
				<el-form-item style="">
				    <el-button @click="resetSearchForm('searchForm')">重置</el-button>
				    <el-button @click="exportForm('searchForm')" v-if="allButton||exportButton">导出</el-button>
				    <!-- <el-button @click="handleDownload('searchForm')">导出</el-button>
				    <el-button @click="doExport('searchForm')">导出</el-button> -->
				</el-form-item>
			</el-form>
		</div>
		<div id="tableBox" style="margin:0 25px;" >
			<el-table :data="tableData.data" border  >
			    <el-table-column label="订单号" width="120" fixed>
			      <template scope="scope">
			        <span >{{ scope.row.orderNumber }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="资金方" width="80">
			      <template scope="scope">
			        <span >{{ scope.row.funderName }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="经销商" width="250">
			      <template scope="scope">
			        <span >{{ scope.row.dealerName }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="业务员" width="80">
			      <template scope="scope">
			        <span >{{ scope.row.businessName }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="汽车车型" :min-width="300">
			      <template scope="scope">
			        <span >{{ scope.row.carName }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="车架号" :min-width="300">
			      <template scope="scope">
			        <span >{{ scope.row.vin }}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="打款日期" width="160">
			      <template scope="scope">
			        <span >{{ scope.row.orderRemitStartTime | parseTime}}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="垫资周期" width="80">
			      <template scope="scope">
			        <span >{{ scope.row.maximum }}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="预计到期日" width="100">
			      <template scope="scope">
			        <span >{{ scope.row.expectedFinishDate | parseTime('{y}-{m}-{d}')}}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="截止日期" width="100">
			      <template scope="scope">
			        <span >{{ scope.row.nowDate | parseTime('{y}-{m}-{d}')}}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="总天数" width="80" >
			      <template scope="scope" >
			        <span :style="{'color':scope.row.sumDay!=scope.row.interestDay?'red':''}">{{ scope.row.sumDay }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="系统计算服务费天数" width="150">
			      <template scope="scope">
			        <span :style="{'color':scope.row.sumDay!=scope.row.interestDay?'red':''}">{{ scope.row.interestDay }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="服务费是否异常" width="120">
			      <template scope="scope">
			        <span >{{ scope.row.isInterest }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="是否逾期" width="80">
			      <template scope="scope">
			        <span >{{ scope.row.isOver }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="逾期天数" width="80">
			      <template scope="scope">
			        <span >{{ scope.row.overDay }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="采购总价格" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.totalPrice||0 )|toFixed2 }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="定金金额" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.earnest ||0 )|toFixed2}}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="垫资金额" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.paymentAmount||0 )|toFixed2 }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="保证金" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.deposit||0 )|toFixed2 }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="服务费比率" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.interestRate-0).toFixed(4) }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="服务费2比率" width="120">
			      <template scope="scope">
			        <span >{{ ((scope.row.overInterestRate-0)*10).toFixed(4) }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="服务费" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.interest||0 )|toFixed2 }}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="服务费2" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.exceed||0 )|toFixed2 }}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="应收款金额" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.allPrice||0 )|toFixed2 }}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="已回款金额" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.totalReturnPrice||0 )|toFixed2 }}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="待回款金额" width="120">
			      <template scope="scope">
			        <span >{{ (scope.row.returnMoney ||0 )|toFixed2}}</span>
			      </template>
			    </el-table-column>
			     <el-table-column label="订单状态" width="80" fixed="right">
			      <template scope="scope">
			        <span >{{ carOrderStatusMap[scope.row.status] }}</span>
			      </template>
			    </el-table-column>
			    <el-table-column label="操作" width="80" fixed="right">
			      <template scope="scope">
			      	<el-button size="small" @click="handleSee(scope.$index, scope.row)" v-if="allButton||viewButton">查看</el-button>
			      </template>
			    </el-table-column>
			</el-table>
			<el-dialog  title="应收账款详情" v-if="dialogSendData.dialogFormVisible" :visible.sync="dialogSendData.dialogFormVisible"  :lock-scroll='true' top=5% :close-on-click-modal="false" :closeOnPressEscape="false">
				<dialogForm :dialogSendData="dialogSendData" :tableData="tableData" ></dialogForm>
			</el-dialog>
	    </div>
	    <div class="block" style="text-align: center;margin-top: 15px;position:relative;">
	    	<pagination v-on:refreshSeachData="seachData"  :tableData="tableData" :searchForm="searchForm"></pagination>
	    	<!-- <el-button  style="position:absolute;right:25px;top:0;" type="primary" @click="handleAdd()">添 加</el-button> -->
		</div>
	</div>
</template>
<script src="./index.js">
	

</script>
